import java.util.ArrayList;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 23735
 * Date: 2023-05-11
 * Time: 9:19
 */

public class MyCalendar {

    private ArrayList<int[]> list;
    public MyCalendar() {
        this.list = new ArrayList<>();
    }

    public boolean book(int start, int end) {
        for (int[] arr: list) {
            // 注意这里面不用包括等号
            if (start < arr[1] && end > arr[0]) {
                return false;
            }
        }
        list.add(new int[]{start, end});
        return true;
    }
}

